import { createRouter, createWebHashHistory } from 'vue-router'
import index from '../views'
import home from '../views/pages/home.vue'
import login from '../views/pages/login.vue'
import newsList from '@/views/pages/news/list'
import forumList from '@/views/pages/forum/list'
import yonghuList from '@/views/pages/yonghu/list'
import yonghuDetail from '@/views/pages/yonghu/formModel'
import yonghuAdd from '@/views/pages/yonghu/formAdd'
import yonghuRegister from '@/views/pages/yonghu/register'
import yonghuCenter from '@/views/pages/yonghu/center'
import xiangqinduixiangList from '@/views/pages/xiangqinduixiang/list'
import xiangqinduixiangDetail from '@/views/pages/xiangqinduixiang/formModel'
import xiangqinduixiangAdd from '@/views/pages/xiangqinduixiang/formAdd'
import storeupList from '@/views/pages/storeup/list'
import xiangqinhuodongList from '@/views/pages/xiangqinhuodong/list'
import xiangqinhuodongDetail from '@/views/pages/xiangqinhuodong/formModel'
import xiangqinhuodongAdd from '@/views/pages/xiangqinhuodong/formAdd'

const routes = [{
		path: '/',
		redirect: '/index/home'
	},
	{
		path: '/index',
		component: index,
		children: [{
			path: 'home',
			component: home
		}
		, {
			path: 'newsList',
			component: newsList
		}
		, {
			path: 'forumList',
			component: forumList
		}
		, {
			path: 'yonghuList',
			component: yonghuList
		}, {
			path: 'yonghuDetail',
			component: yonghuDetail
		}, {
			path: 'yonghuAdd',
			component: yonghuAdd
		}
		, {
			path: 'yonghuCenter',
			component: yonghuCenter
		}
		, {
			path: 'xiangqinduixiangList',
			component: xiangqinduixiangList
		}, {
			path: 'xiangqinduixiangDetail',
			component: xiangqinduixiangDetail
		}, {
			path: 'xiangqinduixiangAdd',
			component: xiangqinduixiangAdd
		}
		, {
			path: 'storeupList',
			component: storeupList
		}
		, {
			path: 'xiangqinhuodongList',
			component: xiangqinhuodongList
		}, {
			path: 'xiangqinhuodongDetail',
			component: xiangqinhuodongDetail
		}, {
			path: 'xiangqinhuodongAdd',
			component: xiangqinhuodongAdd
		}
		]
	},
	{
		path: '/login',
		component: login
	}
	,{
		path: '/yonghuRegister',
		component: yonghuRegister
	}
]

const router = createRouter({
  history: createWebHashHistory(process.env.BASE_URL),
  routes
})

export default router
